import './index.css';

interface MyPromotePriceProps {
  price: number;
  propmotePrice?: number;
  className?: string;
  priceClassName?: string;
  propmotePriceClassName?: string;
}

const MyPromotePrice: React.FC<MyPromotePriceProps> = (prop) => {
  return (
    <div className={'price-container ' + prop.className}>
      <div
        className={
          prop.priceClassName
            ? prop.priceClassName
            : prop.propmotePrice
            ? 'invalidated-price'
            : 'active-price'
        }
      >
        ¥{prop.price.toFixed(2)}
      </div>
      {prop.propmotePrice ? (
        <div className={prop.propmotePriceClassName ? prop.propmotePriceClassName : 'active-price'}>
          ¥{prop.propmotePrice.toFixed(2)}
        </div>
      ) : null}
    </div>
  );
};

export default MyPromotePrice;
